package at.codejedi.sto.model.combat;

import java.io.File;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToOne;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;
import org.hibernate.annotations.GenericGenerator;

@Entity
public class CombatModel {

	private File filePath;

	private CombatLog parsedLog;

	private String uuid;

	public CombatModel() {

	}

	public CombatModel(File filePath, CombatLog parsedLog) {
		this.parsedLog = parsedLog;
		this.filePath = filePath;
	}

	public File getFilePath() {
		return filePath;
	}

	@OneToOne
	@Cascade(CascadeType.ALL)
	public CombatLog getParsedLog() {
		return parsedLog;
	}

	@Id
	@GeneratedValue(generator = "system-uuid")
	@GenericGenerator(name = "system-uuid", strategy = "uuid")
	@Column(name = "uuid", unique = true)
	public String getUuid() {
		return uuid;
	}

	public void setFilePath(File filePath) {
		this.filePath = filePath;
	}

	public void setParsedLog(CombatLog parsedLog) {
		this.parsedLog = parsedLog;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

}
